= api_form_for @create_invoice, :url => invoice_path(:create_invoice) do |f|

  .row
    .span5
      %legend Create invoice request
      = f.fields_for :invoice do |invoice|
        = invoice.input :merchantEmail
        = invoice.input :payerEmail
        = invoice.input :currencyCode
        = invoice.input :paymentTerms
    .span5
      %legend Items
      = f.fields_for :invoice do |invoice|
        = invoice.fields_for :itemList do |list|
          = list.fields_for :item do |item|
            = item.input :name
            = item.input :quantity
            = item.input :unitPrice


  .form-actions
    = f.submit "Submit", :class => "btn btn-primary", :data => { :disable_with => "Processing.." }

- if @create_invoice_response
  = render 'api_response', :request => @create_invoice, :response => @create_invoice_response
